/**
 * Created by linxiaofen on 2017/5/16.
 */
'use strict';
app.component('personalResume',{
        templateUrl:'./view/template/resume.html',
        controller:function(httpService, $timeout){
            var ctrl = this;
            httpService.getResume.query(function(data){
                ctrl.data = data;
            });
            angular.element(document).ready(function () {
                scrollBarsCtrl();
            });
            function scrollBarsCtrl() {
                if (window.matchMedia("(max-width: 800px)").matches) {
                    $("#resume").mCustomScrollbar("destroy");
                } else {
                    $("#resume").mCustomScrollbar({
                        theme: "dark-2",
                        contentTouchScroll: true,
                        advanced: {
                            updateOnContentResize: true,
                            updateOnBrowserResize: true,
                            autoScrollOnFocus: false
                        }
                    });
                }
            }
            $('#resume').ready(function() {

                $('.skillBar').each(function() {
                    $(this).find('.skillBar-bar').width(0);
                });

                $('.skillBar').each(function() {
                    $(this).find('.skillBar-bar').animate({
                        width: $(this).attr('data-percent')
                    }, 2000);
                });

            });
        }

});